package com.hitqz.robot.daemon.quartz.bean;

import com.hitqz.robot.daemon.quartz.dao.AgvDao;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.reactive.function.client.WebClient;
import org.springframework.web.reactive.function.client.support.WebClientAdapter;
import org.springframework.web.service.invoker.HttpServiceProxyFactory;

/**
 * @author xupkun
 * @date 2024/10/14
 */
@Configuration
public class AutoConfigureAgv {

    @Bean
    public AgvDao agvDao() {
        WebClient webClient = WebClient.builder()
                .baseUrl("http://276to9673ki4.vicp.fun/api/v1/centreApp/").build();
        HttpServiceProxyFactory proxyFactory = HttpServiceProxyFactory
                .builder()
                .exchangeAdapter(WebClientAdapter.create(webClient))
                .build();
        return proxyFactory.createClient(AgvDao.class);
    }


}
